//
//  AfanHomeTitleButton.swift
//  weiboOfAfan
//
//  Created by afan on 16/3/24.
//  Copyright © 2016年 阿范. All rights reserved.
//

import UIKit

class AfanHomeTitleButton: UIButton {
    convenience init(imageName: String,title: String?){
        self.init()
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        sizeToFit()
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        
        titleLabel!.frame.origin.x = 0
        
        imageView?.frame.origin.x = titleLabel!.frame.width + 3
    }
}
